<?php
/**
 * Created by Phpstorm
 * User: 一个猫
 * Date: 2023/11/27
 * Time: 10:38
 */

namespace App\Server;

use EasyWeChat\Factory;

class WeChatServer
{
    public $app;

    public function __construct()
    {
        $config = [
            'app_id' => 'wx209612acfa6998a0',
            'secret' => '6a7fea4855d60273dff9679229e91e63',

            // 下面为可选项
            // 指定 API 调用返回结果的类型：array(default)/collection/object/raw/自定义类名
            'response_type' => 'array',

            'log' => [
                'level' => 'debug',
                'file' => __DIR__.'/wechat.log',
            ],
        ];

        $this->app = Factory::miniProgram($config);
    }
}
